#ifndef AQUARIUM_MODES_H
#define AQUARIUM_MODES_H

#include <avr/pgmspace.h>
#include "Arduino.h"

#include <LiquidCrystal.h>
#include <EEPROM.h>

#include "utility.h";
#include "Clock.h";

const byte MODES_NUMBER_OF_TIMERS     = 3;  

extern PROGMEM const char *modes_name_table[];

typedef enum { eNOT_ACTIVE , eWHEN_ON , eWHEN_OFF } Float_Mode ;
 
class Aquarium_Modes
{
public:
  bool mode_change;
  
  Aquarium_Modes();

  void update(); // call evry new min
  void update_sec(); // call evry new sec
  void Print(byte Mode_num);
  void Print();
  void Print_Float_Status(Float_Mode Float_Mode);
  Float_Mode DecFloats_Mode(Float_Mode Float_Mode);
  Float_Mode IncFloats_Mode(Float_Mode Float_Mode);
  
  byte get_Aquarium_mode() { 
    return Curr_Aquarium_mode;
  }
  void MoveToMode( byte ModeNum );


  void SetMoveTo(byte ModeNum, byte Mode);
  byte GetMoveTo(byte ModeNum);
  void SetMoveToAfter(byte ModeNum, byte Time);
  byte GetMoveToAfter(byte ModeNum);
  void SetTimer_On(byte ModeNum, byte Timer ,bool On);
  bool GetTimer_On(byte ModeNum, byte Timer);
  void SetTimer_HR(byte ModeNum, byte Timer ,byte HR );
  byte GetTimer_HR(byte ModeNum, byte Timer);
  void SetTimer_MIN(byte ModeNum, byte Timer ,byte Min);
  byte GetTimer_MIN(byte ModeNum, byte Timer);
  void SetTimer_DAY(byte ModeNum, byte Timer ,byte Day);
  byte GetTimer_DAY(byte ModeNum, byte Timer);
  void SetTimer_MoveTo(byte ModeNum, byte Timer ,byte MoveTo);
  byte GetTimer_MoveTo(byte ModeNum, byte Timer);
  void SetFloat_Mode(byte ModeNum,byte Float_Num,Float_Mode Float_Mode);
  Float_Mode GetFloat_Mode(byte ModeNum,byte Float_Num);
  void SetFloat_MoveTo(byte ModeNum,byte Float_Num,byte inFloat_MoveTo);
  byte GetFloat_MoveTo(byte ModeNum,byte Float_Num);

  void Save_To_EEPROM();

private:
  void init();


  byte Curr_Aquarium_mode;
  byte Timer;

  byte MoveTo[NUMBER_OF_MODES];
  byte MoveToAfter[NUMBER_OF_MODES];

  Float_Mode Floats_Mode[NUMBER_OF_MODES][WATER_LEVEL_NUMBER_OF_FLOATS];
  byte Float_MoveTo[NUMBER_OF_MODES][WATER_LEVEL_NUMBER_OF_FLOATS];
  
  bool Timer_On[NUMBER_OF_MODES][MODES_NUMBER_OF_TIMERS];
  byte Timer_HR[NUMBER_OF_MODES][MODES_NUMBER_OF_TIMERS];
  byte Timer_MIN[NUMBER_OF_MODES][MODES_NUMBER_OF_TIMERS];
  byte Timer_DAY[NUMBER_OF_MODES][MODES_NUMBER_OF_TIMERS];
  byte Timer_MoveTo[NUMBER_OF_MODES][MODES_NUMBER_OF_TIMERS];

};


#endif




